package com.chenyaowei.member.service.impl;

import com.chenyaowei.member.domain.CywMemberStatisticsInfo;
import com.chenyaowei.member.mapper.CywMemberStatisticsInfoMapper;
import com.chenyaowei.member.service.ICywMemberStatisticsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员统计信息Service业务层处理
 * 
 * @author 陈耀威
 * @date 2023-11-30
 */
@Service
public class CywMemberStatisticsInfoServiceImpl implements ICywMemberStatisticsInfoService 
{
    @Autowired
    private CywMemberStatisticsInfoMapper cywMemberStatisticsInfoMapper;

    /**
     * 查询会员统计信息
     * 
     * @param id 会员统计信息主键
     * @return 会员统计信息
     */
    @Override
    public CywMemberStatisticsInfo selectCywMemberStatisticsInfoById(Long id)
    {
        return cywMemberStatisticsInfoMapper.selectCywMemberStatisticsInfoById(id);
    }

    /**
     * 查询会员统计信息列表
     * 
     * @param cywMemberStatisticsInfo 会员统计信息
     * @return 会员统计信息
     */
    @Override
    public List<CywMemberStatisticsInfo> selectCywMemberStatisticsInfoList(CywMemberStatisticsInfo cywMemberStatisticsInfo)
    {
        return cywMemberStatisticsInfoMapper.selectCywMemberStatisticsInfoList(cywMemberStatisticsInfo);
    }

    /**
     * 新增会员统计信息
     * 
     * @param cywMemberStatisticsInfo 会员统计信息
     * @return 结果
     */
    @Override
    public int insertCywMemberStatisticsInfo(CywMemberStatisticsInfo cywMemberStatisticsInfo)
    {
        return cywMemberStatisticsInfoMapper.insertCywMemberStatisticsInfo(cywMemberStatisticsInfo);
    }

    /**
     * 修改会员统计信息
     * 
     * @param cywMemberStatisticsInfo 会员统计信息
     * @return 结果
     */
    @Override
    public int updateCywMemberStatisticsInfo(CywMemberStatisticsInfo cywMemberStatisticsInfo)
    {
        return cywMemberStatisticsInfoMapper.updateCywMemberStatisticsInfo(cywMemberStatisticsInfo);
    }

    /**
     * 批量删除会员统计信息
     * 
     * @param ids 需要删除的会员统计信息主键
     * @return 结果
     */
    @Override
    public int deleteCywMemberStatisticsInfoByIds(Long[] ids)
    {
        return cywMemberStatisticsInfoMapper.deleteCywMemberStatisticsInfoByIds(ids);
    }

    /**
     * 删除会员统计信息信息
     * 
     * @param id 会员统计信息主键
     * @return 结果
     */
    @Override
    public int deleteCywMemberStatisticsInfoById(Long id)
    {
        return cywMemberStatisticsInfoMapper.deleteCywMemberStatisticsInfoById(id);
    }

    @Override
    public CywMemberStatisticsInfo selectInfoByMemberId(Long userId) {
        return cywMemberStatisticsInfoMapper.selectInfoByMemberId(userId);
    }

    @Override
    public int updateCommentCount(Long userId, Integer num) {
        return cywMemberStatisticsInfoMapper.updateCommentCount(userId, num);
    }

    @Override
    public int updateCouponCount(Long userId, Integer num, Integer integration) {
        return cywMemberStatisticsInfoMapper.updateCouponCount(userId, num, integration);
    }
}
